<!DOCTYPE html>
<html>
<#assign ctx=springMacroRequestContext.contextPath />
<#assign user=Session["SESSION_USER"] />
<head>
<title>模板配置</title>
<#include "/header.html">
<link rel="stylesheet" href="${ctx}/css/bootstrap-table.min.css">
<link rel="stylesheet" href="${ctx}/plugins/treegrid/jquery.treegrid.css">
<script src="${ctx}/libs/bootstrap-table.min.js"></script>
<script src="${ctx}/plugins/treegrid/jquery.treegrid.min.js"></script>
<script src="${ctx}/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
<script src="${ctx}/plugins/treegrid/jquery.treegrid.extension.js"></script>
<script src="${ctx}/plugins/treegrid/tree.table.js"></script>
</head>
<body>
<div id="autocodeapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<#if user.userType == 1>
				<a class="btn btn-primary" @click="addTemplate"><i class="fa fa-plus"></i>&nbsp;新增模板</a>
				<a class="btn btn-primary" @click="addTemplateDetail"><i class="fa fa-plus"></i>&nbsp;新增模板文件</a>
				<a class="btn btn-primary" @click="copyTemplateDetail"><i class="fa fa-plus"></i>&nbsp;复制模板文件</a>
				<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
				<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
			<a class="btn btn-primary" href="${ctx}/export/keywordsDemo.htm"><i class="fa fa-star"></i>&nbsp;模板关键字示例</a>
		</div>
		<table id="templateConfigTable" data-mobile-responsive="true" data-click-to-select="true">
			<thead>
			<tr>
				<th data-field="selectItem" data-checkbox="true"></th>
			</tr>
			</thead>
		</table>
	</div>

	<div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			
			<div  v-if="templateConfig.type == 0" class="form-group">
				<div class="col-sm-2 control-label">模板名称</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="templateConfig.templateName" placeholder="模板名称"/>
				</div>
			</div>
			<div  v-if="templateConfig.type == 1" class="form-group">
				<div class="col-sm-2 control-label">模板ID</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="templateConfig.templateId" readonly="readonly"/>
				</div>
			</div>
			<div  v-if="templateConfig.type == 1" class="form-group">
				<div class="col-sm-2 control-label">模板文件名称</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="templateConfig.templateFileName" placeholder="模板文件名称"/>
				</div>
			</div>
			<div  v-if="templateConfig.type == 1" class="form-group">
				<div class="col-sm-2 control-label">模板文件类型</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="templateConfig.templateType" placeholder="模板文件类型"/>
				</div>
			</div>
			<div  v-if="templateConfig.type == 1" class="form-group">
				<div class="col-sm-2 control-label">子包路径</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="templateConfig.templatePath" placeholder="子包路径"/>
				</div>
			</div>
			
			<div  v-if="templateConfig.type == 1" class="form-group">
				<div class="col-sm-2 control-label">模板文件内容</div>
				<div class="col-sm-10">
					<textarea rows="16" class="form-control" v-model="templateConfig.templateContent" placeholder="模板文件内容"></textarea>
				</div>
			</div>
			
			<div class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>


  <!-- 修改密码 -->
<div id="templateFileContentLayer" style="display: none;">
	<iframe src="" style="width: 100%;height: 300px;">
	
	</iframe>
</div>

<script src="${ctx}/js/templateConfig/list.js?_${.now?long}"></script>
</body>
</html>